<?php
require_once('conn.inc.php');
@$conn		=		mysql_connect($db_host,$db_user,$db_pwd);
mysql_query("set names 'utf8'");
mysql_select_db($db_name);

@$keyword = $_POST['keyword'];

@$select = "select * from home where roomname like '%$keyword%' order by id desc"; //LIMIT 0,10
$rs		= mysql_query($select);
$results = array();
while ($xx = mysql_fetch_assoc($rs)) {
	$results[] = $xx;
}
// 将数组转成json格式
echo json_encode($results);
mysql_close();
